package com.beta.em.home;

/**
 * Created by vector on 2016/11/17.
 */
public enum HomeBannerType {

    PRODUCTS("products", "商品"),
    NEWS("news", "新闻"),
    DEALER("dealer", "大B");

    private String value;

    private String cnValue;

    HomeBannerType(String value, String cnValue) {
        this.value = value;
        this.cnValue = cnValue;
    }

    public String getValue() {
        return this.value;
    }

    public String getCnValue() {
        return this.cnValue;
    }

    public static String getCnValue(String value) {
        String cnValue;
        for (HomeBannerType status: values()) {
            if (status.getValue().equals(value)) {
                return status.getCnValue();
            }
        }
        return null;
    }

    public static HomeBannerType getBannerType(String value) {
        for (HomeBannerType bannerType: values()) {
            if (bannerType.getValue().equals(value)) {
                return bannerType;
            }
        }
        return null;
    }

}
